{% macro pagination_widget(pagination, endpoint) %}
    <ul class="pagination  am-pagination tpl-pagination">
        <li{% if not pagination.has_prev %} class="disabled"{% endif %}>
            <a style='background-color: lightgoldenrodyellow;color: brown;' href="{% if pagination.has_prev %}{{ url_for(endpoint,
page = pagination.page - 1, **kwargs) }}{% else %}#{% endif %}">
                «
            </a>
        </li>
        {% for p in pagination.iter_pages() %}
            {% if p %}
                {% if p == pagination.page %}
                    <li class="active">
                        <a style='background-color: lightgoldenrodyellow;color: brown;'
                           href="{{ url_for(endpoint, page = p, **kwargs) }}">{{ p }}</a>
                    </li>
                {% else %}
                    <li>
                        <a style='background-color: lightgoldenrodyellow;color: brown;'
                           href="{{ url_for(endpoint, page = p, **kwargs) }}">{{ p }}</a>
                    </li>
                {% endif %}
            {% else %}
                <li class="disabled">
                    <a href="#">…</a>
                </li>
            {% endif %}
        {% endfor %}
        <li{% if not pagination.has_next %} class="disabled"{% endif %}>
            <a style='background-color: lightgoldenrodyellow;color: brown;' href="

                    {% if pagination.has_next %}{{ url_for(endpoint,page = pagination.page + 1, **kwargs) }}{% else %}#{% endif %}">
                »
            </a>
        </li>
    </ul>
{% endmacro %}